<!--
 * @Author: GKN
 * @Date: 2023-10-24 11:53:29
 * @LastEditTime: 2023-11-30 15:27:02
 * @LastEditors: GKN
 * @Description: 
 * @FilePath: \mod\src\view\user\mNumber\order.vue
 * 可以输入预定的版权声明、个性签名、空行等
-->
<template>
    <div class="flex flex-w">
        <div class="subscribe" v-for="(item,i) in list_subscribe" :key="i">
            <div :class="item.select?'active item':'item'" @click="click_subscribe(i,item.select)">
                {{item.name}}
            </div>
            
        </div>
    </div>
    <div class="MarT35">
        <el-table :data="tableData" stripe style="width: 100%" @row-dblclick="rowDblclick">
            <el-table-column prop="name" label="商品名称" header-row-class-name="headn" >
                
            </el-table-column>
            <el-table-column prop="name" label="订单状态" >
                <template #default="scope">
                    <span style="color:#d10b00;">--</span>
                </template>
            </el-table-column>
            <el-table-column prop="date" label="下单时间" >
                <template #default="scope">
                    <span >{{ proxy.$comJs.timeChange(scope.row.ct*1000) }}</span>
                </template>
                
            </el-table-column>
        </el-table>
    </div>
</template>

<script setup>
import { ref,reactive,getCurrentInstance } from "vue";
const { proxy } = getCurrentInstance();
import CryptoJS from 'crypto-js';
import { useRouter } from "vue-router";
    const ty = ref(0)
    const tableData = ref([])
    const userOrder=(tag)=>{
        proxy.$http.request(proxy.$api.user_order+'?pageSize=50&prevTag=0&nextTag=0&ty=0&tag='+tag,'get',{},false, function (res) {
            if(res&&res.data){
                tableData.value = res.data.data.list?res.data.data.list:[]
            }
        })
    }
    userOrder('')
    const index_subscribe = ref(0)
    const list_subscribe = ref([
        {name:'全部订单',select:true},{name:'已支付',select:false},{name:'未支付',select:false}
    ])
    const list_select_subscribe = ref([])
    const click_subscribe = (i,type)=>{
        list_subscribe.value.map((item)=>{
            item.select = false
        })
        list_subscribe.value[i].select = true
        index_subscribe.value = i
        userOrder(i)
    }
    
</script>

<style lang='less' scoped>
.subscribe{
    width: 20%;
    padding: 14px;
    .item{
        border-radius: 30px;
        border:1px solid #e9e9e9;
        color: #333;
        font-size: 16px;
        height: 55px;
        line-height: 55px;
        cursor: pointer;
        text-align: center;
    }
    .active{
        background: #d00b00;
        color: #fff;
    }
}
/deep/.el-table tr:first-child th{
    background: #e9e9e9;
    color: #333333;
}
</style>
  
  
